export default {
  name: "protocolinfo-item-manage",
  data() {
    return {
      isActive: 1,
      focuses: [{
          focus: "all-list"
        }, //全部
        {
          focus: "pending-list"
        }, //待审批
        {
          focus: "approvaled-list"
        } //已审批
      ],
      // 非锁定表格
      // businessBillId:"6187"
      // businessBillName:"发票录入"
      // businessBillType:"S0501"

      // businessBillId:"2300"
      // businessBillName:"发票冲销"
      // businessBillType:"S0502"
      unfixedTableThead: [{
          label: "审批类型",
          prop: "todoData.businessBillTypeCode1",
          width: "100"
        },
        {
          label: "发票单名称",
          prop: "businessData.invoiceName",
          width: "180"
        },
        {
          label: "供应商",
          prop: "businessData.partyBName",
          width: "180"
        },
        // {
        //   label: "合同签订单位",
        //   prop: "businessData.contractSignDeptName",
        //   width: "180"
        // },
        {
          label: "结算单编号",
          prop: "businessData.settlementCode",
          width: "150"
        },
        {
          label: "结算单名称",
          prop: "businessData.settlementName",
          width: "150"
        },
        {
          label: "填报单位",
          prop: "businessData.reportInOrgName",
          width: "200"
        },
        {
          label: "发票金额(含税)",
          prop: "businessData.currentInvoiceAmountString",
          align: "right",
          width: "130"
        },
        {
          label: "编制人",
          prop: "businessData.compileUser",
          width: "80"
        },
        {
          label: "编制日期",
          prop: "businessData.compileDate",
          width: "100",
          check: true,
          // formatterName: "wirteTimeHandler"
        },
        {
          label: "审批状态",
          prop: "todoData.workItemStatusString",
          width: "100"
        }
      ],
      businessBillType: {
        S0501: "发票录入",
        S0502: "发票冲销"
      },
      bizStatusType: {
        // 2:"编辑中",
        // 3:"待审批",
        // 4:"已撤回",
        // 5:"审批通过",
        // 6:"审批退回",
        // 7:"审批不通过",
        // 9:"已生效",
        // 11:"已删除",
        // 21:"冲销中",
        // 22:"已冲销"
        '1':"审批中",  
        '2':"已撤回",  
        '3':"审批通过",  
        '4':"审批退回",  
        '5':"审批不通过",
      },
    };
  },
  methods: {
    // 页签跳转
    tabChange(data, index) {
      console.log("tab:", data);
      this.$router.push(`/invoice/invoiceApproval/${data}`);
    },
    goApproval(row, index) {
      const {
        businessData, 
        todoData
      } = row;
      this.$store.dispatch("setBusinessList", todoData);
      const businessList = JSON.stringify(todoData);
      sessionStorage.setItem("businessList", businessList);
      const businessDataList = JSON.stringify(businessData);
      sessionStorage.setItem("businessDataList", businessDataList);
      if (row.todoData.businessBillTypeCode1 == "发票录入") {
        console.log("2222",row);
        // let myId = row.todoData.businessBillId;
        this.$router.push(
          // `/invoice/invoiceApproval/invoice-add/${myId}`
          {
            path: "/invoice/invoiceApproval/invoice-add/",
            query: {
              myId: row.todoData.businessBillId,
              type:"approval",
            },
          }
        );
      } else if (row.todoData.businessBillTypeCode1 == "发票冲销") {
        this.$router.push(
          // `/invoice/invoiceApproval/written-off/${row.todoData.businessBillId}`
          {
            path: "/invoice/invoiceApproval/written-off/",
            query: {
              id: row.todoData.businessBillId,
              type:"approval",
            },
          }
        );
      }
    }
  },
};